$(function(){
	var walletType=sessionStorage.getItem("walletType");
	var logonToken=sessionStorage.getItem("logonToken");
	var playId=sessionStorage.getItem("playId");
	
	var json = {
        "logonToken": logonToken,
        "walletType": walletType,
        "playId":playId
    }
    $.ajax({
        type: "post",
        url: url + '/bigWinner/api/team/show',
        data: JSON.stringify(json),
        dataType: 'json',
        contentType: "application/json",
        success: function(result) {
            if(result.success) {
            	$(".pushNum").val(result.obj.pushNum);
            	$(".pushbalance").val(result.obj.pushbalance);
            	$(".teamNum").val(result.obj.teamNum);
            	$(".teamBalance").val(result.obj.teamBalance);
            	$(".profit").val(result.obj.profit);
            	$(".teamProfit").val(result.obj.teamProfit);
//          	二维码
            	$("#foo").val(result.obj.link);
           		makeCode();
            } else {
                isErr(result);
            }
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            alert("请求失败："+XMLHttpRequest.status);
        }
    });
})
//	生成二维码
var qrcode = new QRCode(document.getElementById("QR"), {
    width: 200,
    height: 200
});

function makeCode() {
    var elText = document.getElementById("foo");
    if (!elText.value) {
        alert("Input a text");
        elText.focus();
        return;
    }
    qrcode.makeCode(elText.value);
}